package chapter03;

import java.util.Scanner;

/**
 * 获取一维数组都最小值
 * Created by a on 2017/6/9.
 */
public class Test042 {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        for (int i=0;i<str.length();i++){
            char charAt = str.charAt(i);
            if (!Character.isDigit(charAt)&&charAt!=' '){
                System.out.println("输入非数字内容");
                return;
            }
        }
        String[] numStr = str.split(" ");
        int[] numInt = new int[numStr.length];
        for (int i =0;i<numInt.length;i++){
            numInt[i] = Integer.valueOf(numStr[i]);
        }
        int min = numInt[0];
        for (int j = 0;j<numInt.length;j++){
            if (min>numInt[j]){
                min = numInt[j];
            }
        }
        System.out.println("数组中最小数值为："+min);

    }

}
